#ifndef _STRINGPARTSOURCE_HPP_
#define _STRINGPARTSOURCE_HPP_

#include "jhdefs.hpp"
#include "net/PartSource.hpp"
#include <sstream>
#include <string>

NET_NAMESPACE_BEGIN

class CStringPartSource : public CPartSource
{
public:
	CStringPartSource(const std::string& str);
	CStringPartSource(const std::string& str, const std::string& mediaType);
	CStringPartSource(const std::string& str, const std::string& mediaType, const std::string& filename);
	~CStringPartSource();

	std::istream& stream();
	const std::string& filename() const;
	std::streamsize getContentLength() const;

private:
	std::istringstream m_istr;
	std::string        m_filename;

	CStringPartSource(const CStringPartSource&);
	CStringPartSource& operator = (const CStringPartSource&);
};


NET_NAMESPACE_END

#endif
